<template>
  <el-dialog
    title="友情提示"
    :visible.sync="dialogVisible"
    width="30%"
    :before-close="handleClose"
  >
    <span>{{ msg }}</span>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="sure">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      msg: ''
    }
  },
  methods: {
    handleClose(done) {
      done()
    },
    showDialog(msg) {
      this.dialogVisible = true
      this.msg = msg
    },
    sure() {
      this.dialogVisible = false
      this.$emit('sure')
    }
  }
}
</script>
